package com.demo.common.utils;

import sun.util.resources.cldr.CalendarData;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;

public class LocalDateTimeUtil {

    private static final String DATETIME_PATTERN = "yyyy-MM-dd hh:mm:ss.sss";

    /**
     * 当前日期时间
     * @return yyyy-MM-dd hh:mm:ss.sss
     */
    public static String getLocalDateTime() {
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern(DATETIME_PATTERN));
    }

    /**
     * 返回当前日期
     * @return java.util.Date
     */
    public static Date newDate() {
        return new Date();
    }

}
